<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">
    <title>申请处理</title>
    <link rel="stylesheet" href="/asset/layui/css/layui.css">
    <link rel="stylesheet" href="/asset/css/base.css?v=20190989">
    <link rel="Shortcut Icon" href="cachet.ico">
    <script type="text/javascript" src="/asset/js/jquery-3.3.1.min.js"></script>
	<script src="/asset/layui/layui.js"></script>
    <script src="/asset/js/common.js"></script>
</head>
<body >
<div class="x-body">
<form class="layui-form">
	<input type="hidden" name="applyVerifyId" value="${verify.applyVerifyId}">
    
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">申请印章</label>
      <div class="layui-input-inline layui-form-mid">
        ${verify.apply.seal.sealName}1
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">申请时间</label>
      <div class="layui-input-inline layui-form-mid">
        ${verify.apply.applyTime?string('yyyy-MM-dd HH:mm:ss')}
      </div>
    </div>
  </div>
  
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">申请类型</label>
      <div class="layui-input-inline layui-form-mid">
        ${verify.apply.applyType}
      </div>
    </div>
    <div class="layui-inline">
      <label class="layui-form-label">申请人</label>
      <div class="layui-input-inline layui-form-mid">
        ${verify.apply.person.name}
      </div>
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">申请次数</label>
    <div class="layui-input-inline layui-form-mid">
      ${verify.apply.applyTimes}
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">申请事由</label>
    <div class="layui-input-inline layui-form-mid">
      ${verify.apply.cause}
    </div>
  </div>
  
  <div class="layui-form-item">
    <div class="layui-inline">
      <label class="layui-form-label">相关附件</label>
      <div class="layui-input-inline" style="width:600px">
		    <table class="layui-table">
		      <thead>
		          <tr>
			        <th>文件名</th>
			        <th>操作</th>
			      </tr>
		      </thead>
		      <tbody>
		      		<#if upfiles?? && upfiles?size gt 0>
		      		<#list upfiles as item>
		      		<tr>
		      			<td>${item.fileName}</td>
		      			<td><a href="${item.fileUrl}">查看</td>
		      		</tr>
		      		</#list>
		      		<#else>
		      		<tr>
		      			<td colspan=2 style="text-align:center">暂无附件</td>
		      		</tr>
		      		</#if>
		      		
		      </tbody>
		    </table>
        </div>
    </div>
  </div>
  
  <#if verify.verifyStatus =='PENDING'>
  <div class="layui-form-item">
    <label class="layui-form-label">审核结果</label>
    <div class="layui-input-block">
      <input type="radio" name="verifyStatus" value="PASSED" title="同意" checked="">
      <input type="radio" name="verifyStatus" value="REJECT" title="拒绝">
    </div>
  </div>
  
  <div class="layui-form-item">
    <label class="layui-form-label">审核意见</label>
    <div class="layui-input-inline" style="width:600px">
      <textarea name="verifyResult" placeholder="请输入内容" class="layui-textarea"></textarea>
    </div>
  </div>
  
  <div class="layui-form-item">
    <div class="layui-input-block">
      <button class="layui-btn" lay-submit="" lay-filter="submit">立即提交</button>
      <button type="reset" class="layui-btn layui-btn-primary">重置</button>
    </div>
  </div>
  <#else>
    <div class="layui-form-item">
	    <label class="layui-form-label">审核详情</label>
	    <div class="layui-input-block">
	      
	        <ul class="layui-timeline">
			  <li class="layui-timeline-item">
			    <i class="layui-icon layui-timeline-axis"></i>
			    <div class="layui-timeline-content layui-text">
			      <div class="layui-timeline-title">${verify.apply.applyTime?string('yyyy-MM-dd HH:mm:ss')}，${verify.apply.person.name}（${verify.apply.person.position}）发布申请</div>
			    </div>
			  </li>
			  <#list verifys as item>
			  <li class="layui-timeline-item">
			    <i class="layui-icon layui-timeline-axis"></i>
			    <div class="layui-timeline-content layui-text">
			      <div class="layui-timeline-title">
			      		<#if item.verifyTime??>${item.verifyTime?string('yyyy-MM-dd HH:mm:ss')}</#if>，${item.person.name}（${item.person.position}）
			      		
			      		<#if item.verifyStatus =='PASSED'>
			      			审核通过
			      		<#else>
			      			拒绝通过，原因：${item.verifyResult}
			      		</#if>
			      </div>
			    </div>
			  </li>
			  </#list>
			</ul>
	    </div>
	  </div>
  </#if>
</form>
 

</form>
</div>   
    <script>
        layui.use(['form','layer','laydate','upload'], function(){
            $ = layui.jquery;
          var form = layui.form,layer = layui.layer;

          //监听提交
          form.on('submit(submit)', function(data){
            $.ajax({
      			type:"POST", 
      			url:"/verify/submit.htm",
      			data:data.field,
      			success:function(result) {
		      
		      		if(result.code=='1'){
		      			layer.alert("增加成功", {icon: 6},function () {
			                // 获得frame索引
			                 window.parent.location.reload();
			                var index = parent.layer.getFrameIndex(window.name);
			                //关闭当前frame
			                parent.layer.close(index);
			            });
		      		}else{
		      		 	layer.msg(result.msg);
		      		}
		      
		    	 	} 
		    }); 
            
            return false;
          });
          
        });
    </script>

</body>
</html>